Protect against concurrent access to Cargo.lock
authorAlex Crichton <alex@alexcrichton.com>
Tue, 5 Apr 2016 23:32:13 +0000 (16:32 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 6 Apr 2016 16:56:14 +0000 (09:56 -0700)
commit6f6d7c8d198b199388f907952cc0c8c80e49f93f
tree354119dc26db73c79e3f130815a55adc0c716488
parenta9fd1c2c05b8fca16d44ac2f930ff4f7d6188f1e
Protect against concurrent access to Cargo.lock

CI tests seen to be spurious failing on OSX due to this, I believe it's because
one process is concurrently writing out Cargo.lock while the other is trying to
read it in, so one of them gets a corrupt version.

This would ideally be fixed from `pkg.root()` returning a `Filesystem`, but that
was unfortunately such an invasive change that it seemed untenable. Additionally
we generally don't write files into the source tree, so if this is the only
instance it's perhaps not so bad trying to be robust in to the future.
src/cargo/ops/cargo_generate_lockfile.rs
src/cargo/ops/cargo_pkgid.rs
src/cargo/ops/lockfile.rs
src/cargo/ops/mod.rs
src/cargo/ops/resolve.rs
tests/test_cargo_generate_lockfile.rs
tests/tests.rs